<?php
	require_once($_SERVER['DOCUMENT_ROOT']."/classes/GameSession.class.php");
	require_once($_SERVER['DOCUMENT_ROOT']."/classes/Member.class.php");
	require_once($_SERVER['DOCUMENT_ROOT']."/includes/sugar.php");
	session_start();
	$sessionToDelete = new GameSession($_POST['id']);
	$_SESSION['member']->loadSessions();
	if($sessionToDelete->delete()){
		$array['errMess'] = getErrMess(13);
		$array['status'] = 1;
		$array['link'] = "http://".$_SERVER['SERVER_NAME']."/index.php?module=member";
		$_SESSION['member']->loadSessions();
	}
	else
	{
		$array['errMess'] = getErrMess(12);
		$array['status'] = 0;
	}
	echo json_encode($array);
?>